package ils.services;

import ils.domain.ugc.model.Review;
import ils.util.HibernateSession;
import ils.util.HibernateSessionManager;
import ils.util.SpringUtil;
import junit.framework.Assert;
import org.junit.Test;
import org.springframework.context.ApplicationContext;

/**
 * Created with IntelliJ IDEA.
 * User: rejeevd
 * Date: 6/10/12
 * Time: 6:15 PM
 * To change this template use File | Settings | File Templates.
 */
public class UgcServiceTest
{
    private ApplicationContext context = SpringUtil.getApplicationContext();
    private UgcService ugcService = (UgcService)context.getBean("ugcService");

    @Test
    public void testCreateReview()
    {
        Review review = new Review();
        review.setUserId(3);
        review.setBookId(1);
        review.setRating(3);
        review.setReview("this is test review");
        review = ugcService.createReview(review);
        Assert.assertNotNull(review.getId());
    }
}
